Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Browser#openAndWait for convenience(Fixes #28) #30

Merged

Conversation

abocz
Copy link
Member

@abocz abocz commented Feb 23, 2015

I'm not sure what the best way to make the predetermined duration for openAndWait(ViewUrl<T> viewUrl configurable. Also not sure if you wanted to add javadocs here, but I gave it a shot.

@abocz abocz changed the title Add Browser#openAndWait for convience (Fixes #28) Add Browser#openAndWait for convenience(Fixes #28) Feb 23, 2015
@alechenninger
Copy link
Member

I don't like the 2-minute baked in wait time. I would just add the duration as an argument. You could have two overrides that follow the similar pattern as waitUpTo does as well (one accepts duration, other accepts integer and chrono unit).

What we really probably want is this to be implemented: darcy-framework/synq#17 , as this would be the right way to do default wait times (as opposed to just assuming two minutes, which is really probably much too long... that we tend to have settled on that as a common default internally shouldn't really have a baring in the framework itself).

Then you could just browser.open(urlFor.myView()).await();

*/
default <T extends View> T openAndWait(ViewUrl<T> viewUrl) {
return open(viewUrl).waitUpTo(Duration.of(2, ChronoUnit.MINUTES));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this override -- I don't like the hard coded 2 minute wait time here. We can address default times in Synq -- darcy-framework/synq#17

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 27769a0 on abocz:add-openandwait-to-browser into * on darcy-framework:master*.

@alechenninger
Copy link
Member

Awesome, thanks!

alechenninger added a commit that referenced this pull request Apr 17, 2015
Add Browser#openAndWait for convenience (fixes #28)
@alechenninger alechenninger merged commit 77cd868 into darcy-framework:master Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants